﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using metroCIS.Library;

namespace metroCIS.ViewModel
{
    public class RssViewModel
    {
        private ObservableVector<RssItem> rssItems;
        ObservableVector<RssItem> rssList;
        CisManager manager;

        public RssViewModel()
        {
            manager = CisManager.Create();
            rssList = new ObservableVector<RssItem>();
            Refresh();
        }

        #region PROPERTIES

        public ObservableVector<RssItem> RssList
        {
            get { return rssList; }
        }

        #endregion

        #region METHODS

        private async void Refresh()
        {
            CisManager manager = CisManager.Create();

            foreach (var item in await manager.GetRssFeed())
            {
                rssList.Add(item);
            }
        }

        #endregion
    }
}
